package arith;

import java.util.Random;

public class BuildEquation {
	
	public Problem makeEqu(int equType, int diff){
		if(equType == 0){
			//Add Numbers
			return add(diff);
		}
		if(equType == 1){
			//Subtract Numbers
			return sub(diff);
		}
		if(equType == 2){
			//Multiply Numbers
			return mult(diff);
		}
		if(equType == 3){
			//Divide Numbers
			return div(diff);
		}
		if(equType == 4){
			//Add Fractions
			return fracAdd(diff);
		}
		if(equType == 5){
			//Subtract Fractions
			return fracSub(diff);
		}
		if(equType == 6){
			//Multiply Fractions
			return fracMult(diff);
		}
		if(equType == 7){
			//Divide Fractions
			return fracDiv(diff);
		}
		if(equType == 8){
			//Add Exponents
			return expAdd(diff);
		}
		if(equType == 9){
			//Subtract Exponents
			return expSub(diff);
		}
		if(equType == 10){
			//Multiply Exponents
			return expMult(diff);
		}
		if(equType == 11){
			//Divide Exponents
			return expDiv(diff);
		}
		return null;
	}
	
	public Problem add(int difficulty){
		if(difficulty == 0){
			AddOperation add = new AddOperation(randomChar(), randomChar());
			return add.getProblem();
		}
		return null;
	}

	public Problem sub(int difficulty){
		if(difficulty == 0){
			SubOperation sub = new SubOperation(randomChar(), randomChar());
			return sub.getProblem();
		}
		return null;
	}
	
	public Problem mult(int difficulty){
		if(difficulty == 0){
			MultOperation mult = new MultOperation(randomChar(), randomChar());
			return mult.getProblem();
		}
		return null;
	}
	
	public Problem div(int difficulty){
		if(difficulty == 0){
			DivOperation div = new DivOperation(randomChar(), randomChar());
			return div.getProblem();
		}
		return null;
	}
	
	public Problem fracAdd(int difficulty){
		if(difficulty == 0){
			AddFrac fAdd = new AddFrac();
			return fAdd.getProblem();
		}
		return null;
	}
	
	public Problem fracSub(int difficulty){
		if(difficulty == 0){
			SubFrac fSub = new SubFrac();
			return fSub.getProblem();
		}
		return null;
	}
	
	public Problem fracMult(int difficulty){
		if(difficulty == 0){
			MultFrac fMult = new MultFrac();
			return fMult.getProblem();
		}
		return null;
	}
	
	public Problem fracDiv(int difficulty){
		if(difficulty == 0){
			DivFrac fDiv = new DivFrac();
			return fDiv.getProblem();
		}
		return null;
	}
	
	public Problem expAdd(int difficulty){
		if(difficulty == 0){
			AddExp eAdd = new AddExp();
			return eAdd.getProblem();
		}
		return null;
	}
	
	public Problem expSub(int difficulty){
		if(difficulty == 0){
			SubExp eSub = new SubExp();
			return eSub.getProblem();
		}
		return null;
	}
	
	public Problem expMult(int difficulty){
		if(difficulty == 0){
			MultExp eMult = new MultExp();
			return eMult.getProblem();
		}
		return null;
	}
	
	public Problem expDiv(int difficulty){
		if(difficulty == 0){
			DivExp eDiv = new DivExp();
			return eDiv.getProblem();
		}
		return null;
	}
	
	public char randomChar(){
		Random random = new Random();
		return (char) (random.nextInt(23) + 'a');
	}
	
	public int randomInt(){
		Random randomGenerator = new Random();
		return randomGenerator.nextInt(10);
	}
	
	public Input numAdd(Numbers num1, Numbers num2){
		return new Numbers(num1.number + num2.number, "");
	}
}
